import request from "@/utils/request";
import { AxiosPromise } from "axios";
import { UserForm, UserInfo, UserPageVO, UserQuery } from "./types";

/**
 * 登录成功后获取用户信息（昵称、头像、权限集合和角色集合）
 */
export function getUserInfoApi(): AxiosPromise<UserInfo> {
  return request({
    url: "/pharmacist/info",
    method: "get",
  });
}
// 首页统计
export function getanalyze() {
  return request({
    url: "/prescribe/analyze",
    method: "get",
  });
}

// 审单列表

export function verifyList(data: any) {
  return request({
    url: "/prescribe/verify/list",
    method: "post",
    data: data
  });
}
// 审单列表详情
export function detail(data: any) {
  return request({
    url: "/prescribe/detail",
    method: "post",
    data: data
  });
}
// 审单
export function verify(data: any) {
  return request({
    url: "/prescribe/verify",
    method: "post",
    data: data
  });
}

//修改密码
export function updatePass(data: any) {
  return request({
    url: "/pharmacist/pwd/update",
    method: "post",
    data: data
  });
}

//维护物流
export function shipping(data: any) {
  return request({
    url: "/prescribe/drugs/shipping",
    method: "post",
    data: data
  });
}


/**
 * 导入用户
 *
 * @param file
 */
export function update(file: File) {
  const formData = new FormData();
  formData.append("headPic", file);
  return request({
    url: "/pharmacist/icon/update",
    method: "post",
    data: formData,
    headers: {
      "Content-Type": "multipart/form-data",
    },
  });
}
